3.239 \(\int (a \sin (c+d x)+b \tan (c+d x))^2 \, dx\)

Optimal. Leaf size=77 \[ -\frac{a^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac{a^2 x}{2}-\frac{2 a b \sin (c+d x)}{d}+\frac{2 a b \tanh ^{-1}(\sin (c+d x))}{d}+\frac{b^2 \tan (c+d x)}{d}-b^2 x \]

[Out]

(a^2*x)/2 - b^2*x + (2*a*b*ArcTanh[Sin[c + d*x]])/d - (2*a*b*Sin[c + d*x])/d - (a^2*Cos[c + d*x]*Sin[c + d*x])
/(2*d) + (b^2*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.115877, antiderivative size = 77, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 8, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.421, Rules used = {4397, 2722, 2635, 8, 2592, 321, 206, 3473} \[ -\frac{a^2 \sin (c+d x) \cos (c+d x)}{2 d}+\frac{a^2 x}{2}-\frac{2 a b \sin (c+d x)}{d}+\frac{2 a b \tanh ^{-1}(\sin (c+d x))}{d}+\frac{b^2 \tan (c+d x)}{d}-b^2 x \]

Antiderivative was successfully verified.

[In]

Int[(a*Sin[c + d*x] + b*Tan[c + d*x])^2,x]

[Out]

(a^2*x)/2 - b^2*x + (2*a*b*ArcTanh[Sin[c + d*x]])/d - (2*a*b*Sin[c + d*x])/d - (a^2*Cos[c + d*x]*Sin[c + d*x])
/(2*d) + (b^2*Tan[c + d*x])/d

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rule 2722

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.), x_Symbol] :> Int[Expan
dIntegrand[(g*Tan[e + f*x])^p, (a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2
, 0] && IGtQ[m, 0]

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps

\begin{align*} \int (a \sin (c+d x)+b \tan (c+d x))^2 \, dx &=\int (b+a \cos (c+d x))^2 \tan ^2(c+d x) \, dx\\ &=\int \left (a^2 \sin ^2(c+d x)+2 a b \sin (c+d x) \tan (c+d x)+b^2 \tan ^2(c+d x)\right ) \, dx\\ &=a^2 \int \sin ^2(c+d x) \, dx+(2 a b) \int \sin (c+d x) \tan (c+d x) \, dx+b^2 \int \tan ^2(c+d x) \, dx\\ &=-\frac{a^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac{b^2 \tan (c+d x)}{d}+\frac{1}{2} a^2 \int 1 \, dx-b^2 \int 1 \, dx+\frac{(2 a b) \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac{a^2 x}{2}-b^2 x-\frac{2 a b \sin (c+d x)}{d}-\frac{a^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac{b^2 \tan (c+d x)}{d}+\frac{(2 a b) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac{a^2 x}{2}-b^2 x+\frac{2 a b \tanh ^{-1}(\sin (c+d x))}{d}-\frac{2 a b \sin (c+d x)}{d}-\frac{a^2 \cos (c+d x) \sin (c+d x)}{2 d}+\frac{b^2 \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.605068, size = 116, normalized size = 1.51 \[ -\frac{-2 \left (a^2-2 b^2\right ) (c+d x)+\tan (c+d x) \left (a^2 \cos (2 (c+d x))+a^2-4 b^2\right )+8 a b \sin (c+d x)+8 a b \log \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )-8 a b \log \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*Sin[c + d*x] + b*Tan[c + d*x])^2,x]

[Out]

-(-2*(a^2 - 2*b^2)*(c + d*x) + 8*a*b*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - 8*a*b*Log[Cos[(c + d*x)/2] + S
in[(c + d*x)/2]] + 8*a*b*Sin[c + d*x] + (a^2 - 4*b^2 + a^2*Cos[2*(c + d*x)])*Tan[c + d*x])/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.045, size = 99, normalized size = 1.3 \begin{align*} -{\frac{{a}^{2}\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2\,d}}+{\frac{{a}^{2}x}{2}}+{\frac{{a}^{2}c}{2\,d}}-2\,{\frac{ab\sin \left ( dx+c \right ) }{d}}+2\,{\frac{ab\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}-{b}^{2}x+{\frac{{b}^{2}\tan \left ( dx+c \right ) }{d}}-{\frac{{b}^{2}c}{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*sin(d*x+c)+b*tan(d*x+c))^2,x)

[Out]

-1/2*a^2*cos(d*x+c)*sin(d*x+c)/d+1/2*a^2*x+1/2/d*a^2*c-2*a*b*sin(d*x+c)/d+2/d*a*b*ln(sec(d*x+c)+tan(d*x+c))-b^
2*x+b^2*tan(d*x+c)/d-1/d*b^2*c

________________________________________________________________________________________

Maxima [A]  time = 1.57076, size = 113, normalized size = 1.47 \begin{align*} \frac{{\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2}}{4 \, d} - \frac{{\left (d x + c - \tan \left (d x + c\right )\right )} b^{2}}{d} + \frac{a b{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

1/4*(2*d*x + 2*c - sin(2*d*x + 2*c))*a^2/d - (d*x + c - tan(d*x + c))*b^2/d + a*b*(log(sin(d*x + c) + 1) - log
(sin(d*x + c) - 1) - 2*sin(d*x + c))/d

________________________________________________________________________________________

Fricas [A]  time = 0.525144, size = 279, normalized size = 3.62 \begin{align*} \frac{{\left (a^{2} - 2 \, b^{2}\right )} d x \cos \left (d x + c\right ) + 2 \, a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - 2 \, a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) -{\left (a^{2} \cos \left (d x + c\right )^{2} + 4 \, a b \cos \left (d x + c\right ) - 2 \, b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/2*((a^2 - 2*b^2)*d*x*cos(d*x + c) + 2*a*b*cos(d*x + c)*log(sin(d*x + c) + 1) - 2*a*b*cos(d*x + c)*log(-sin(d
*x + c) + 1) - (a^2*cos(d*x + c)^2 + 4*a*b*cos(d*x + c) - 2*b^2)*sin(d*x + c))/(d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a \sin{\left (c + d x \right )} + b \tan{\left (c + d x \right )}\right )^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))**2,x)

[Out]

Integral((a*sin(c + d*x) + b*tan(c + d*x))**2, x)

________________________________________________________________________________________

Giac [B]  time = 2.31427, size = 3715, normalized size = 48.25 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*a^2*x - 1/4*a^2*sin(2*d*x + 2*c)/d - (b^2*d*x*tan(d*x)*tan(1/2*d*x)^2*tan(1/2*c)^2*tan(c) + a*b*log(2*(tan
(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + ta
n(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)
^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1))*tan(d*x)*tan(1/2*d*x)^2*tan(1/2*c)^2*tan(c) - a*b*log(
2*(tan(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^
2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/
2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1))*tan(d*x)*tan(1/2*d*x)^2*tan(1/2*c)^2*tan(c) - b^
2*d*x*tan(1/2*d*x)^2*tan(1/2*c)^2 + b^2*d*x*tan(d*x)*tan(1/2*d*x)^2*tan(c) + b^2*d*x*tan(d*x)*tan(1/2*c)^2*tan
(c) - a*b*log(2*(tan(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)
^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c
)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1))*tan(1/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an(1/2*d*x)^4*
tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2
*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d
*x) - 2*tan(1/2*c) + 1))*tan(d*x)*tan(1/2*c)^2*tan(c) - a*b*log(2*(tan(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c
)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*
c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*t
an(1/2*c) + 1))*tan(d*x)*tan(1/2*c)^2*tan(c) - 4*a*b*tan(d*x)*tan(1/2*d*x)*tan(1/2*c)^2*tan(c) + b^2*tan(1/2*d
*x)^2*tan(1/2*c)^2*tan(c) - b^2*d*x*tan(1/2*d*x)^2 - b^2*d*x*tan(1/2*c)^2 + b^2*d*x*tan(d*x)*tan(c) - a*b*log(
2*(tan(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^
2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/
2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1))*tan(1/2*d*x)^2 + a*b*log(2*(tan(1/2*c)^2 + 1)/(t
an(1/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)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/
2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1))*tan(d*x)*tan(c) -
a*b*log(2*(tan(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan
(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 +
2*tan(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1))*tan(d*x)*tan(c) + 4*a*b*tan(d*x)*tan(1/2
*d*x)*tan(c) + b^2*tan(1/2*d*x)^2*tan(c) + 4*a*b*tan(d*x)*tan(1/2*c)*tan(c) + b^2*tan(1/2*c)^2*tan(c) - b^2*d*
x - a*b*log(2*(tan(1/2*c)^2 + 1)/(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3
*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^
2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)) + a*b*log(2*(tan(1/2*c)^2 + 1)/(tan(
1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan
(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 +
2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)) + b^2*tan(d*x) - 4*a*b*tan(1/2*d*x) - 4*a*b*tan(1/2*c) + b^2*tan(c))/(d*ta
n(d*x)*tan(1/2*d*x)^2*tan(1/2*c)^2*tan(c) - d*tan(1/2*d*x)^2*tan(1/2*c)^2 + d*tan(d*x)*tan(1/2*d*x)^2*tan(c) +
 d*tan(d*x)*tan(1/2*c)^2*tan(c) - d*tan(1/2*d*x)^2 - d*tan(1/2*c)^2 + d*tan(d*x)*tan(c) - d)